import { ObjectPool } from "../../../Core/Module/ObjectPool/ObjectPool";
import { IDisposable } from "../../../Core/Object/DisposeObject";
import { List } from "./Collections/List";

export class ListComponent<T> extends List<T> implements IDisposable {

    public static Create<T>(): ListComponent<T> {
        return ObjectPool.Instance.Fetch(ListComponent<T>) as ListComponent<T>;
    }

    public Dispose(): void {
        this.Clear();
        ObjectPool.Instance.Recycle(this);
    }

}